package com.woniuxy.config;

import com.woniuxy.entity.MinioProp;
import io.minio.MinioClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @program: day09014
 * @description:
 * minioClient:minio的客户端，去操作minio（上传下载）
 * @create: 2024-09-23 11:23
 **/
@Configuration
public class MinioConfig {
    @Autowired
    private MinioProp minioProp;

    @Bean
    public MinioClient minioClient() throws Exception {
        return MinioClient.builder().endpoint(minioProp.getEndPoint())
                .credentials(minioProp.getAccessKey(), minioProp.getSecretKey()).build();
    }
}